package homework.work4;

public class Main {
    public static void main(String[] args) {
        String s="legendary";
        String str="";
        for (int i = 0; i < s.length(); i++) {
            if(i%2==0){
                str+=Character.toUpperCase(s.charAt(i));
            }else {
                str+=Character.toLowerCase(s.charAt(i));
            }
        }
        System.out.println("str = " + str);
    }
}
